const carouselImages = document.querySelector('.carousel-images');
const prevButton = document.querySelector('.carousel-button-prev');
const nextButton = document.querySelector('.carousel-button-next');
let currentIndex = 0;

function updateCarousel() {
    carouselImages.style.transform = `translateX(-${currentIndex * 100}%)`;
}

prevButton.addEventListener('click', () => {
    currentIndex--;
    if (currentIndex < 0) {
        currentIndex = carouselImages.children.length - 1;
    }
    updateCarousel();
});

nextButton.addEventListener('click', () => {
    currentIndex++;
    if (currentIndex >= carouselImages.children.length) {
        currentIndex = 0;
    }
    updateCarousel();
});
